import java.util.Scanner;

public class Search1 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int count = 0;
        while (n != 0){
            n = n & (n - 1);
            count++;
        }
        System.out.println(count);
    }
    public static void main1(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int count = 0;
        for (int i = 0; i < 32; i++) {
            if(((n >> i) & 1) == 1){
                count++;
            }
        }
        System.out.println(count);
    }
}
